package com.ucode.cgms.sapi.mcs;

import cn.hutool.core.util.ObjUtil;
import com.ucode.cgms.api.CgmsMemberRemoteApi;
import com.ucode.member.service.MemberService;
import com.ucode.model.member.Member;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CgmsMemberRemoteApiImpl implements CgmsMemberRemoteApi {

    @Resource
    private MemberService memberService;

    @Override
    public Long queryReferrerIdByMemberId(Long memberId) {
        Member member = memberService.selectByPrimaryKey(memberId);
        return ObjUtil.isNotNull(member) ? member.getReferrerId() : null;
    }
}
